
class Person(object):

    def __init__(self,name,age):
        self.name = name
        self.age  = age


def __init__(self,name,age):
    self.name = name
    self.age  = age

p = Person("Alex",22)

print(type(p))
print(type(Person)) # type 是所有类的源头

dog_class = type("Dog",(object,),{"role":"dog","__init__":__init__}) # type 是所有类的源头
print(dog_class)

d = dog_class("Mjj",22)
print(d.role,d.name,d.age)